package com.study.ming.model;

import java.io.Serializable;
import java.util.Objects;

public class Student implements Serializable {
    private String teachername;
    private String subject;
    private int id;

    public Student() {
    }

    public Student(int id, String teachername, String subject ) {
        this.teachername = teachername;
        this.subject = subject;
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return id == student.id && Objects.equals(teachername, student.teachername) && Objects.equals(subject, student.subject);
    }

    @Override
    public int hashCode() {
        return Objects.hash(teachername, subject, id);
    }

    public String getTeachername() {
        return teachername;
    }

    public void setTeachername(String teachername) {
        this.teachername = teachername;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "teachername='" + teachername + '\'' +
                ", subject='" + subject + '\'' +
                ", id=" + id +
                '}';
    }
}
